﻿using System.Collections;
using System.Dynamic;
using Facebook;
using FacebookAcessLibrary.Interfaces;
using FacebookAcessLibrary.Data;

namespace FacebookAcessLibrary.FacebookClass
{
  
    public class SharesFacebook: IShares
    {
        
        public void WriteShare(string token, Message message)
        {
            var client = new FacebookClient("141208535946866", "378a4f4d0672dd55c7a21ab9362544df");



            dynamic parameters = new ExpandoObject();

            parameters.news = new ArrayList();
            ArrayList j = new ArrayList();
           
            parameters.news.Add(new {message = "FinalmenteUIPI2", action_link = new {text = "Invite", href = "www.google.pt"}
        });
            parameters.uid = 100000160481614;
            parameters.method = "dashboard.addNews";
            dynamic result1 = client.Post(parameters);

            parameters = new ExpandoObject();
            parameters.uid = 100000160481614;
            parameters.method = "dashboard.getNews";
           // _facebook.DashBoard.SendNotificationDashBoard("Ola silvestre", "Invite", "http://www.example.com/gifts?id=5878237");
            dynamic result = client.Post(parameters);


            parameters = new ExpandoObject();
            parameters.uid = 100000160481614;
            parameters.news_ids = new ArrayList();
            parameters.news_ids.Add(result1);
            parameters.method = "dashboard.clearNews";
            // _facebook.DashBoard.SendNotificationDashBoard("Ola silvestre", "Invite", "http://www.example.com/gifts?id=5878237");
            dynamic result2 = client.Post(parameters);
     
            return;
        }
    }
}



